{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<!--BOOK_INFORMATION-->\n",
    "<img align=\"left\" style=\"padding-right:10px;\" src=\"figures/PHydro-cover-small.png\">\n",
    "*This is the Jupyter notebook version of the [Python in Hydrology](http://www.greenteapress.com/pythonhydro/pythonhydro.html) by Sat Kumar Tomer.*\n",
    "*Source code is available at [code.google.com](https://code.google.com/archive/p/python-in-hydrology/source).*\n",
    "\n",
    "*The book is available under the [GNU Free Documentation License](http://www.gnu.org/copyleft/fdl.html). If you have comments, corrections or suggestions, please send email to satkumartomer@gmail.com.*"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<!--NAVIGATION-->\n",
    "< [Execute the Program](01.05-Execute-the-Program.ipynb) | [Contents](Index.ipynb) | [The First Program](01.07-The-First-Program.ipynb) >"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 1.6 错误类型\n",
    "\n",
    "程序中会出现三种错误：语法错误、运行时错误和语义错误。为了快速地跟踪它们，区分他们是很有用的。\n",
    "\n",
    "### 1.6.1 语法错误\n",
    "\n",
    "Python只能在语法正确的情况下执行程序；否则，解释器会显示错误消息。语法指的是程序的结构和关于该结构的规则。举个例子，圆括号必须出现在匹配对中，所以`(1+2)`是合法的，而`8)`是一个语法错误。\n",
    "\n",
    "### 1.6.2 运行错误\n",
    "\n",
    "第二种类型的错误是运行时错误，之所以如此，是因为错误只有当程序开始运行后才会出现。这些错误也被称为异常，因为它们通常表明某些异常的事情(和坏的)发生了。\n",
    "\n",
    "### 1.6.3 语义错误\n",
    "\n",
    "第三种类型的错误是语义错误。如果程序中存在语义错误，它将成功的运行，因为计算机不会产生任何错误消息，但它并不会做正确的事情。"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.5.0"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
